@extends('layouts.home')

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading">
            发布留言
        </div>
        <div class="panel-body">
            @if($errors->has('error'))
            <div class="mark">
                <p>{{ $errors->first('error') }}</p>
            </div>
            @endif
            <form role="form" action="{{ url('message') }}" method="post">
                {{ csrf_field() }}
                <div class="form-group {{ $errors->has('title') ? ' has-error' : '' }}">
                    <label for="" class="control-label">留言主题</label>
                    <div>
                        <input type="text" name="title" value="{{ old('title') }}" class="form-control" placeholder="请填写留言主题">
                        @if ($errors->has('title'))
                            <span class="help-block">
                                <strong>{{ $errors->first('title') }}</strong>
                            </span>
                        @endif
                    </div>
                </div>
                <div class="form-group {{ $errors->has('content') ? ' has-error' : '' }}">
                    <label for="" class="control-label">留言内容</label>
                    <textarea class="form-control" rows="10" name="content" placeholder="请填写留言内容">{{ old('content') }}</textarea>
                    @if ($errors->has('content'))
                        <span class="help-block">
                            <strong>{{ $errors->first('content') }}</strong>
                        </span>
                    @endif
                </div>
                <input type="submit" class="btn btn-primary" value="发表">
            </form>
        </div>
    </div>
@endsection
